package pl.lodz.p.kipme;

import java.util.Date;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import pl.lodz.p.kipme.bo.Category;
import pl.lodz.p.kipme.bo.Order;
import pl.lodz.p.kipme.bo.Product;
import pl.lodz.p.kipme.bo.ProductInfo;
import pl.lodz.p.kipme.bo.ProductOrder;
import pl.lodz.p.kipme.bo.ProductType;
import pl.lodz.p.kipme.bo.Transaction;
import pl.lodz.p.kipme.exception.BusinessException;


//@SOAPBinding(style = Style.RPC)
@WebService
public interface MainService {

    @WebMethod
    public List<Category> getCategoryList();

    @WebMethod
    public List<ProductType> getProductTypeList();

    @WebMethod
    public List<ProductInfo> getProductInfo();
    
    @WebMethod
    public Product getProductByProductCode(@WebParam(name="productCode") String productCode);

    @WebMethod
    public List<Product> getProductsByCategory(@WebParam(name="categoryCode") String categoryCode);

    @WebMethod
    public List<Product> getProductsByType(@WebParam(name="typeCode") String typeCode);

    @WebMethod
    public void reportSale(@WebParam(name="transaction") Transaction transaction);
    
    @WebMethod
    public void placeOrder(@WebParam(name="order") Order order) throws BusinessException;
    
    @WebMethod
    public List<ProductOrder> checkOrderStatus(@WebParam(name="orderId") String orderId);
    
    @WebMethod
    public List<String> getActiveOrderId();
    
    @WebMethod
    public void confirmProductReceive(@WebParam(name="productOrderId") String productOrderId) throws BusinessException;
    
    @WebMethod
    public void updateNumberOfProduct(@WebParam(name="productCode") String productCode, @WebParam(name="newAmount") String newAmount);
    
    @WebMethod
    public int getNumberOfProduct(@WebParam(name="productCode") String productCode);
    
    @WebMethod
    public List<Transaction> getTransactions(@WebParam(name="startDate") Date startDate, @WebParam(name="endDate") Date endDate);
    
    @WebMethod
    public List<Transaction> getTransactionsByProductCode(@WebParam(name="productCode") String productCode);

    @WebMethod
    public void addProduct(@WebParam(name="product") Product product) throws BusinessException;

    @WebMethod
    public void updateProduct(@WebParam(name="product") Product product) throws BusinessException;

    @WebMethod
    public void removeProduct(@WebParam(name="productCode") String productCode);
    
    
    
    
    
}
